package com.dianxin.smartpark.web.property;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.chinatelecom.response.common.CommonResponseBody;
import com.dianxin.smartpark.dao.qo.property.SmartParkPropertyCleaningQO;
import com.dianxin.smartpark.service.property.SmartParkPropertyCleaningService;
import com.dianxin.smartpark.service.vo.property.SmartParkPropertyCleaningVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 保洁管理
 * 
 * @author chenjiasong
 * @date 2021-07-28
 */
@RestController
@RequestMapping("/smartpark/cleaning")
public class SmartParkPropertyCleaningController
{
    @Resource
    private SmartParkPropertyCleaningService smartParkPropertyCleaningService;

    /**
     * 查询保洁管理列表
     */
    @GetMapping("/list")
    @SaCheckPermission(value = "/smartpark/cleaning/list")
    public CommonResponseBody<List<SmartParkPropertyCleaningVO>>  list(SmartParkPropertyCleaningQO qo)
    {
        return smartParkPropertyCleaningService.selectSmartParkPropertyCleaningList(qo);
    }


    /**
     * 获取保洁管理详细信息
     */
    @GetMapping(value = "/getInfo")
    @SaCheckPermission(value = "/smartpark/cleaning/getInfo")
    public CommonResponseBody<SmartParkPropertyCleaningVO> getInfo(SmartParkPropertyCleaningQO qo)
    {
        return smartParkPropertyCleaningService.selectSmartParkPropertyCleaning(qo);
    }

    /**
     * 新增保洁管理
     */
    @PostMapping("/add")
    @SaCheckPermission(value = "/smartpark/cleaning/add")
    public  CommonResponseBody<Boolean> add(@RequestBody SmartParkPropertyCleaningVO vo)
    {
        return smartParkPropertyCleaningService.insertSmartParkPropertyCleaning(vo);
    }

    /**
     * 修改保洁管理
     */
    @PutMapping("/edit")
    @SaCheckPermission(value = "/smartpark/cleaning/edit")
    public  CommonResponseBody<Boolean> edit(@RequestBody SmartParkPropertyCleaningVO vo)
    {
        return smartParkPropertyCleaningService.updateSmartParkPropertyCleaning(vo);
    }

    /**
     * 删除保洁管理
     */
	@DeleteMapping("/remove")
    @SaCheckPermission(value = "/smartpark/cleaning/remove")
    public  CommonResponseBody<Boolean> remove(@RequestBody SmartParkPropertyCleaningVO vo)
    {
        return smartParkPropertyCleaningService.deleteSmartParkPropertyCleaning(vo);
    }
}
